package com.h3c.nem.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.File;


@FeignClient(name = "sfs.url", url = "${sfs.url}")
public interface SfsFeignClient {


    /**
     *
     *
     * @param { "appId": "hrpm",
     *          "pwd": "h3c123456"
     *          }
     * @return
     */
    @PostMapping(value = "user/login", consumes = {"application/json"})
    String getSfsToken(@RequestBody String str);

    @PutMapping(value = "file", consumes = MediaType.ALL_VALUE, headers = {"X-Token={XToken}", "Source-Account={SourceAccount}"})
    String uploadFileToSfs(@RequestParam("files") File files,
                           @RequestParam("shareLevel") String shareLevel,
                           @RequestParam("path") String path,
                           @RequestParam("parentFileSid") Long parentFileSid,
                           @RequestParam("XToken") String XToken,
                           @RequestParam("SourceAccount") String SourceAccount);

//    @PostMapping(value = "file/preview", consumes = {"application/json"}, headers = {"X-Token={XToken}", "Source-Account={SourceAccount}"})
//    String filePreview(@RequestParam("enableWatermark") Integer enableWatermark,
//                       @RequestParam("XToken") String XToken,
//                       @RequestParam("SourceAccount") String SourceAccount);

//    @GetMapping(value = "employee/findEmployeeById", consumes = {"application/json"}, headers = {"Authorization={Authorization}"})
//    String findEmployeeById(@RequestParam("account") String account, @RequestParam("Authorization") String Authorization);
}
